/**
 * @description 格式化数据
 * @param data
 * @param mainTable
 * @param subTables
 */
export const format = (data: any, mainTable: string, subTables: string[]) => {
  return data["[]"].map(item => {
    let result = { ...item[mainTable] };
    subTables.forEach(subTable => {
      if (item[subTable]) {
        result[subTable] = item[subTable];
      }
    });
    return result;
  });
};
